#pragma once
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
#include <mutex>
#include <queue>
#include <thread>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <map>

#include "common/common_tool.h"
#include "camera/hikbase.h"
#include "app/local_tool.h"

using namespace camera;
namespace app {

class SmartBox;

class CameraManager
{
public:
	CameraManager(SmartBox* box, CameraGroup* cam_ifo, LogInfo* log_ifo);
	~CameraManager();

public:
  int run();
  int stop();

private:
	int create_algo();
	int run_imp();
	int update_op(int64 cur_time, int64& sys_time, int64& upload_time, cv::Mat& img);
	int analysis_data(std::vector<RecSewageData>& his_data, sewageStatus& sstatus);
	std::string post_video(PostInfo& post_ifo);

public:
	HikBase* cam;
	CameraGroup* cam_grp;

private:
	LogInfo *log_ifo;
	SmartBox* box;


	int64 prev_time;
	std::atomic_int stop_status;
	// ConfigInfo* cfg_ifo;
};

}   // namespace smartbox
